//
//  LandmarkList.swift
//  Landmarks
//
//  Created by 北京 on 2021/1/27.
//

import SwiftUI

struct LandmarkList: View {
    
    var body: some View {
        
        NavigationView{
            List(landmarks) { landmark in
                NavigationLink(destination: LandmarkDetail(landmark: landmark)) {
                    LandmarkRow(landmark: landmark)
                }

            }
            .navigationTitle("landmarks")
           
        }
     
    }
}

struct LandmarkList_Previews: PreviewProvider {
    
    static var previews: some View {
//        ForEach(["iPhone SE", "iPhone 11"], id: \.self) { deviceName in
//            LandmarkList()
//                .previewDevice(PreviewDevice(rawValue: deviceName))
//                .previewDisplayName(deviceName)
//        }
        LandmarkList()
            .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
            .previewDisplayName("iPhone 11")
    }
}
